// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IResultSegment.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Exception for errors when handling Windows Azure Cloud Drives.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Wrapper for <see cref="ResultSegment{TElement}"/> (Represents a result segment that was retrieved from the total set of possible results.)
	/// </summary>
	/// <typeparam name="T">The type of results in the segment.</typeparam>
	public interface IResultSegment<T>
	{
		/// <summary>
		/// Gets the <see cref="ResultSegment{TElement}.ContinuationToken"/>
		/// </summary>
		ResultContinuation ContinuationToken { get; }

		/// <summary>
		/// Gets a value indicating whether <see cref="ResultSegment{TElement}.HasMoreResults"/> is true.
		/// </summary>
		bool HasMoreResults { get; }

		/// <summary>
		/// Gets <see cref="ResultSegment{TElement}.Results"/>
		/// </summary>
		IEnumerable<T> Results { get; }

		/// <summary>
		/// Gets <see cref="ResultSegment{TElement}.GetNext"/>
		/// </summary>
		/// <returns>
		/// The get next.
		/// </returns>
		IResultSegment<T> GetNext { get; }

		/// <summary>
		/// Calls <see cref="ResultSegment{TElement}.BeginGetNext"/>
		/// </summary>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin get next.
		/// </returns>
		IAsyncResult BeginGetNext(AsyncCallback callback, object state);

		/// <summary>
		/// Calls <see cref="ResultSegment{TElement}.EndGetNext"/>
		/// </summary>
		/// <param name="asyncResult">
		/// The async Result.
		/// </param>
		/// <returns>
		/// The end get next.
		/// </returns>
		IResultSegment<T> EndGetNext(IAsyncResult asyncResult);
	}
}